package com.sojson.project.monitor.server.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sojson.project.monitor.server.entity.po.Server;
import com.sojson.result.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 服务器监控
 *
 * @author lyh
 */
@Api(tags = "服务器监控")
@RestController
@RequestMapping("/server")
public class ServerController {

    /**
     * 获取服务器信息
     * 
     * @return
     * @throws Exception
     */
    @GetMapping
    @PreAuthorize("@ss.hasPermi('/server')")
    @ApiOperation(value = "获取服务器信息", response = Server.class)
    public Result<Server> getInfo() throws Exception {
        Server server = new Server();
        server.copyTo();
        return Result.success(server);
    }

}